%tr
  %td.section
    %table(cellpadding="0" cellspacing="0" border="0" align="left")
      %tbody
        %tr
          %td.content(valign="top")
            %div
              %p
                An error has just occurred in
                = link_to(@app.name, app_url(@app), class: "bold") << ","
                on the
                %span.bold= @notice.environment_name
                environment.
                %br
                This error has occurred #{pluralize @notice.problem.notices_count, "time"}.
              %p
                = link_to("Click here to view the error on Errbit", app_problem_url(@app, @notice.problem), class: "bold") << "."
%tr
  %td.section
    %table(cellpadding="0" cellspacing="0" border="0" align="left")
      %tbody
        %tr
          %td.content(valign="top")
            %div
              %p.heading ERROR MESSAGE:
              %p= @notice.message
              %p.heading WHERE:
              %p.monospace
                = @notice.where
              - @notice.backtrace.lines.each do |line|
                - next unless line.in_app?
                %p.backtrace
                  = line.link_to_source_file(@app) do
                    = line.to_s
              %br
              - if @notice.app_version.present?
                %p.heading APP VERSION:
                %p.monospace
                  = @notice.app_version
                %br
              %br
              - if @notice.server_environment.present? && @notice.server_environment["hostname"].present?
                %p.heading APP SERVER:
                %p.monospace
                  = @notice.server_environment["hostname"]
                %br
              %p.heading URL:
              %p.monospace
                - if @notice.request["url"].present?
                  = link_to @notice.request["url"], @notice.request["url"]
              %p.heading BROWSER:
              %p.monospace
                = user_agent_graph(@notice.problem)
              %br
              - if @notice.user_attributes.present?
                %p.heading USER:
                %table
                  - @notice.user_attributes.each do |key, value|
                    %tr
                      %td(style="text-align: right; padding-right: 10px; color: #6a6a6a;")= key.to_s.titleize + ":"
                      %td= auto_link(value.to_s)
                %br
              - if @notice.backtrace.lines.any?
                %br
                %p.heading FULL BACKTRACE:
                - @notice.backtrace.lines.each do |line|
                  %p.backtrace
                    = line.link_to_source_file(@app) do
                      = line.to_s
                %br
